load("@fbcode_macros//build_defs:cpp_benchmark.bzl", "cpp_benchmark")
load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")

oncall("fboss_agent_push")

cpp_library(
    name = "state_generator",
    srcs = ["StateGenerator.cpp"],
    headers = [
        "StateGenerator.h",
    ],
    exported_deps = [
        "//fboss/agent:agent_stats-cpp2-types",
        "//fboss/agent:switch_config-cpp2-types",
        "//fboss/agent:switch_state-cpp2-types",
        "//fboss/agent/hw:hardware_stats-cpp2-types",
        "//fboss/agent/if:ctrl-cpp2-services",
    ],
)

cpp_library(
    name = "fsdb_benchmark_helper",
    srcs = ["FsdbBenchmarkTestHelper.cpp"],
    headers = [
        "FsdbBenchmarkTestHelper.h",
    ],
    exported_deps = [
        "//fboss/fsdb/client:fsdb_pub_sub",
        "//fboss/fsdb/tests/utils:fsdb_test_server",
        "//fboss/thrift_cow/nodes:nodes",
        "//folly:subprocess",
        "//folly/synchronization:baton",
    ],
    exported_external_deps = [
        "gflags",
    ],
)

cpp_benchmark(
    name = "fsdb_build_bench",
    srcs = [
        "FsdbBenchmarksMain.cpp",
        "FsdbBuildBench.cpp",
    ],
    deps = [
        "fbsource//third-party/googletest:gtest",
        "//folly:benchmark",
        "//folly:format",
        "//folly:subprocess",
        "//folly/init:init",
        "//folly/json:dynamic",
        "//folly/logging:init",
        "//folly/logging:logging",
    ],
    external_deps = [
        "gflags",
    ],
)

cpp_benchmark(
    name = "fsdb_bench_test",
    srcs = [
        "FsdbBenchmarksMain.cpp",
        "FsdbSystemScaleBench.cpp",
        "FsdbSystemScaleChurn.cpp",
        "SysPortAndRIFBench.cpp",
        "VoqCounterScaleBench.cpp",
    ],
    deps = [
        "fbsource//third-party/googletest:gtest",
        ":fsdb_benchmark_helper",
        ":state_generator",
        "//fboss/fsdb/tests/utils:fsdb_test_server",
        "//fboss/lib:common_file_utils",
        "//folly:benchmark",
        "//folly/init:init",
        "//folly/json:dynamic",
        "//folly/logging:init",
        "//folly/logging:logging",
        "//folly/synchronization:baton",
        "//folly/synchronization:latch",
    ],
    external_deps = [
        "gflags",
    ],
)
